#include <regx52.h>
#include "Delay.h"
#include "GYSMG.h"
#include "Key.h"

sbit BEEP = P2^5;

unsigned char Num;
unsigned int i;
void main()
{
	GYSMG(8,0);
	while(1)
	{
		Num = Key();
		if(Num == 1)
		{
			for(i=0;i<50;i++)
			{
				BEEP = ~BEEP;
				Delay(1);
			}
			GYSMG(8,Num);
		}
		
		if(Num == 2)
		{
			for(i=0;i<50;i++)
			{
				BEEP = ~BEEP;
				Delay(2);
			}
			GYSMG(8,Num);
		}
		
		if(Num == 3)
		{
			for(i=0;i<50;i++)
			{
				BEEP = ~BEEP;
				Delay(3);
			}
			GYSMG(8,Num);
		}
		
		if(Num == 4)
		{
			for(i=0;i<50;i++)
			{
				BEEP = ~BEEP;
				Delay(4);
			}
			GYSMG(8,Num);
		}
	}
}